import * as constants from '../Constants'
import { get, GET_GOODS_INFO_LIST } from '../../service/api'


export interface GetNewInfoList {
  type: constants.GetNewInfoList
  payload: Promise<any>
}
export interface GetNewInfoList_PENDING {
  type: constants.GetNewInfoList_PENDING
  payload: Promise<any>
}
export interface GetNewInfoList_FULFILLED {
  type: constants.GetNewInfoList_FULFILLED
  payload: any
}
export interface GetNewInfoList_PAGE {
  type: constants.GetNewInfoList_PAGE
  payload: any
}

export type NewInfoAction = GetNewInfoList | 
  GetNewInfoList_FULFILLED | 
  GetNewInfoList_PENDING | 
  GetNewInfoList_PAGE

export function getNewInfoList(param: any): GetNewInfoList {
  return {
    type: constants.GetNewInfoList,
    payload: get(GET_GOODS_INFO_LIST, param)
  }
}
export function page(page: any): GetNewInfoList_PAGE {
  return {
    type: constants.GetNewInfoList_PAGE,
    payload: page
  }
}